<?php
include_once './service.php';
$json = json_decode(file_get_contents("php://input"));

$server = new Dcservice();
$result = $server->dl($json->username, $json->pwd);

$msgResult = [];

if (empty($result)) {
    $msgResult = ['code' => 0, 'msg' => "登陆成功"];
} else {
    $msgResult = ['code' => -1, 'msg' => $result];
}

header("Content-Type: application/json; charset=UTF-8");
echo json_encode($msgResult);